Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
fs-utils-sync
Advanced tools
Streamline synchronous file system interactions in your Node.js projects with the lightweight fs-utils-sync package. It provides a collection of well-defined utility functions that enforce consistency across projects, ensuring an unified approach to file
Streamline synchronous file system interactions in your Node.js projects with the lightweight fs-utils-sync
package. It provides a collection of well-defined utility functions that enforce consistency across projects, ensuring an unified approach to file system operations.
Install the package:
$ npm install -S fs-utils-sync
project
│
some-dir/
│ └───...
│
some-file.json
import { pathExist, getPathElement } from 'fs-utils-sync';
pathExists('project/some-dir'); // true
pathExists('project/some-file.json'); // true
pathExists('project/other-file.json'); // false
getPathElement('project/other-file.json'); // null
getPathElement('project/some-file.json');
// {
// path: 'project/some-file.json',
// baseName: 'some-file.json',
// extName: '.json',
// isFile: true,
// isDirectory: false,
// isSymbolicLink: false,
// size: 8647,
// creation: 1715264137289,
// }
pathExists(path: string): boolean
getPathElement(path: string): IPathElement | null
isDirectory(path: string): boolean
deleteDirectory(path: string): void
createDirectory(path: string, deleteIfExists?: boolean): void
copyDirectory(srcPath: string, destPath: string): void
createDirectorySymLink(target: string, path: string): void
readDirectory(path: string, recursive?: boolean): string[]
getDirectoryElements(path: string, options?: Partial<IDirectoryElementsOptions>): IDirectoryPathElements
isFile(path: string): boolean
writeFile(path: string, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void
writeTextFile(path: string, data: string): void
writeJSONFile(path: string, data: object | string, space?: number): void
writeBufferFile(path: string, data: Buffer): void
readFile(path: string, options?: IReadFileOptions): string | Buffer
readTextFile(path: string): string
readJSONFile(path: string): object
readBufferFile(path: string): Buffer
copyFile(srcPath: string, destPath: string): void
deleteFile(path: string): void
createFileSymLink(target: string, path: string)
# Unit Tests
$ npm run test:unit
# Integration Tests
$ npm run test:integration
compressDirectory
and decompressDirectory
compressFile
and decompressFile
Install dependencies:
$ npm install
Build the library:
$ npm start
Publish to npm
:
$ npm publish
FAQs
Streamline synchronous file system interactions in your Node.js projects with the lightweight fs-utils-sync package. It provides a collection of well-defined utility functions that enforce consistency across projects, ensuring an unified approach to file
The npm package fs-utils-sync receives a total of 6 weekly downloads. As such, fs-utils-sync popularity was classified as not popular.
We found that fs-utils-sync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.